import request from '@/utils/request'

const globalApi = {
  upload: '/api/v2/admin-files/images',
  rentScooterLogs: '/api/v2/rent-scooter-logs'

}

export function uploadImage (fileData, type) {
  return request({
    headers: {
      'Content-Type': type
    },
    url: globalApi.upload,
    method: 'post',
    data: fileData
  })
}

export function rentScooterLogs () {
  return request({
    url: globalApi.rentScooterLogs,
    method: 'get'
  })
}

export function rentScooterToCarShip (scooterId, carShipId) {
  return (request({
    url: globalApi.rentScooterLogs + '/' + scooterId + '/returned-rental',
    method: 'put',
    data: {
      id: carShipId
    }
  }))
}
